/**
 * jims
 */
package com.jims.master.modules.base.order.dao;

import com.jims.master.common.persistence.CrudDao;
import com.jims.master.common.persistence.annotation.MyBatisDao;
import com.jims.master.modules.base.order.entity.Sorders;
import org.apache.ibatis.annotations.Param;

import java.util.List;


/**
 * 订单信息DAO接口
 * @author qlx
 * @version 2017-05-02
 */
@MyBatisDao
public interface SordersDao extends CrudDao<Sorders> {

    public String getOrderNo();

    /**
     * 累计服务人数
     * @author chent
     * @return
     */
    public String personOrderCount();

    /**
     * 医生中心我的购买服务量
     * @author jicunteng
     * @return
     */
    public String buyOrderCount(@Param("doctorId") String doctorId);

    public Sorders getSordersByOrderNo(@Param("orderNo") String orderNo);

    /**
     * 根据订单号更新订单状态
     * @param orderNo
     * @return
     */
    public int updateStateByOrder(@Param("orderNo") String orderNo, @Param("buyEmail") String buyEmail, @Param("alipyNo") String alipyNo, @Param("alipyStyle") String alipyStyle);

    /**
     * 根据系统服务ID得到签约人数
     * @param defaultId
     * @return
     */
    public  String orderCountByDefaultId(String defaultId);

    /**
     * 查询退款订单
     * @param sorders
     * @return
     */
    public List<Sorders> findDrawBackList(Sorders sorders);

    /**
     * 退款成功更新订单状态
     * @param orderNo
     * @return
     */
    public int updateDrawBackStateByOrder(@Param("orderNo") String orderNo, @Param("orderState") String orderState);


    public  String getSignNum(@Param("serviceId") String serviceId);

    /**
     * 医生收入
     * @param doctorId
     * @return
     */
    public List<Sorders> doctorIncome(@Param("doctorId") String doctorId);

    public List<Sorders> getPatientServer(Sorders sorders);
    /**
     * 我的服务
     * @param personId
     * @return
     */
    public List<Sorders> myService(@Param("personId") String personId);

    public String doctorPlanNum(@Param("doctorId") String doctorId);

    public List<String> getPatientId(@Param("doctorId") String doctorId);

    public List<Sorders> patientList(Sorders sorders);
}